/*
 * =====================================================================================
 *       Filename:  other.c
 *    Description:  
 *        Version:  2.0
 *        Created:  2017.06.03 17:51
 *         Author:  fujiajun (fjj), fujiajun@renren1.com
 *        Company:  HOOLINKS
 * =====================================================================================
 */

#include "xshell.h"

// 0=不存在，1=存在
int is_exist(char* path){
    FILE *fp;

    if((fp = fopen(path, "r")) == NULL) {
        return 0;
    } else {
        fclose(fp);
        return 1;
    }
}

// 0=不是目录，1=是目录
int is_folder(char* path){
    DIR *dp;

    if((dp = opendir(path)) == NULL) {
        return 0;
    } else {
        closedir(dp);
        return 1;
    }
}
